﻿using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;

namespace PLCS.App.Converts;

internal class IconParkVisibilityConvert : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        if (!int.TryParse(value?.ToString(), out int res))
            throw new ArgumentException("Invalid argument type, expected int");

        return res == 0 ? Visibility.Visible : Visibility.Collapsed;
    }

    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
    {
        return null;
    }
}